<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('应答需求申请')" />
	<th:block th:include="include :: select2-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-busReqApply-audit" th:object="${busReqApply}">
            <input id="applyId" name="applyId" th:field="*{applyId}"  type="hidden">
			<input id="reqId" name="reqId" th:field="*{reqId}"  type="hidden">
			<div class="form-group">	
				<label class="col-sm-3 control-label">申请人：</label>
				<div class="col-sm-8">
					<input name="applyUserName" class="form-control" type="text" th:field="*{applyUserName}" disabled>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">申请备注：</label>
				<div class="col-sm-8">
					<textarea id="applyRemark" name="applyRemark" class="form-control" rows="5" th:field="*{applyRemark}" disabled></textarea>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">审核意见：</label>
				<div class="col-sm-8">
					<textarea id="auditRemark" name="auditRemark" maxlength="500" class="form-control" rows="5" th:field="*{auditRemark}"></textarea>
				</div>
			</div>
		</form>
    </div>

	<div class="row">
		<div class="col-sm-offset-5 col-sm-10">
			<button type="button" class="btn btn-sm btn-primary" onclick="pass()"><i class="fa fa-check"></i>通  过</button>&nbsp;
			<button type="button" class="btn btn-sm btn-warning" onclick="noPass()"><i class="fa fa-remove"></i>不通过</button>&nbsp;
			<button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
		</div>
	</div>

    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "system/busReqApply";
		$("#form-busReqApply-audit").validate({
			rules:{
				xxxx:{
					required:true,
				},
			},
			focusCleanup: true
		});

		/** 保存为通过 */
		function pass() {
			if ($.validate.form()) {
				var data = $("#form-busReqApply-audit").serializeArray();
				data.push({"name": "status", "value": "01"});
				$.operate.save(prefix + "/audit", data);
			}
		}

		/** 保存为不通过 */
		function noPass() {
			if ($.validate.form()) {
				var data = $("#form-busReqApply-audit").serializeArray();
				data.push({"name": "status", "value": "99"});
				$.operate.save(prefix + "/audit", data);
			}
		}

	</script>
</body>
</html>
